/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mycompany.fb.visualization.types;

import com.restfb.types.User;

/**
 *
 * @author Mato
 */
public class Friend extends User
{
   
    private String id;
    private String name;
   
    public Friend()
    {
        
    }
    
    public Friend(String id, String name)
    {
        this.id = id;
        this.name = name;
    }
    
    @Override
    public String getId()
    {
        if(id != null)
        {
            return id;
        }
        else
        {
            return super.getId();
        }
    }
    
    @Override
    public String getName()
    {
        if(name != null)
        {
            return name;
        }
        else
        {
            return super.getName();
        }
    }
    
    @Override
    public boolean equals(Object o )
    {
        if(!(o instanceof Friend))
        {
            return false;
        }
        return getId().equals(((Friend) o).getId());
    }
   
    @Override
    public int hashCode()
    {
        
        return getId().hashCode();
    }
}
